#ifndef PROGRAM_H
#define PROGRAM_H
#include <GL\glew.h>

#define MAXPROGRAM 10

class GLSLProgram
{
public:
	GLSLProgram();
	~GLSLProgram();
	bool MakeProgram(char* vertexsh, char* geometrysh=0, char* fragmentsh=0);
	void BeginProgram(); //glUseProgram(prog)
	void EndProgram();
	void BindTexture(GLenum unit,GLenum, GLuint,char*nameinshader);

    void setUniform1f(char*,float);
	void setUniform3f(char* nameinshader, float* value);
	void setUniformMatf(char*, float*);
	void setUniform1uint(char*, unsigned int);

private:
	GLuint prog;
	void _loadshader(char* shadername,char* buffer);
	void _printlog(GLuint obj);

	//handle
	char* buffer;
	GLint len;


};



#endif